﻿using System.Web.Optimization;

namespace Mvc.RazorTools
{
	/// <summary>
	/// The scripts bundle used by MVC Razor Tools.
	/// </summary>
	public class ScriptsBundle : RazorToolsBundle
	{
		internal ScriptsBundle()
			: base("~/Scripts/razortools")
		{
		}

		/// <summary>
		/// Creates a new bundle of the type represented by this instance.
		/// </summary>
		/// <returns>A newly created bundle.</returns>
		protected override Bundle OnGetNewBundle()
		{
			return new ScriptBundle(this.Path);
		}

		/// <summary>
		/// Called to render link tags for a set of paths.
		/// </summary>
		/// <returns>An HTML string containing the link tag or tags for the bundle.</returns>
		protected override System.Web.IHtmlString OnRender()
		{
			return Scripts.Render(this.Path);
		}
	}
}